# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py3-dnslib
_pkgname=dnslib
pkgver=0.9.19
pkgrel=0
pkgdesc="simple library to encode/decode DNS wire-format packets"
url="https://github.com/paulc/dnslib"
arch="noarch"
license="BSD-2-Clause"
depends="python3"
makedepends="py3-setuptools"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

replaces=py-dnslib # Backwards compatibility
provides=py-dnslib=$pkgver-r$pkgrel # Backwards compatibility

# secfixes:
#   0.9.19-r0:
#     - CVE-2022-22846

build() {
	python3 setup.py build
}

check() {
	PYTHONPATH="$PWD/build/lib" python3 dnslib/test_decode.py
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="
3b49bfc9e566ecbd648899fe9bb367b7463a1ba4a2b4487ebdf342918dd0bf9e6281fc62e18568164490c0a22f842bedaeffcb61bbeeea0ef75db9d529e6fb46  dnslib-0.9.19.tar.gz
"
